package com.serve.oa.entity;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 
 * </p>
 *
 * @author __tyw
 * @since 2022-10-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "id2")
    private String username;

    @ExcelProperty(value = "id3")
    @JsonIgnore
    private String password;


    @ExcelProperty(value = "id3")
    private String name;

    @ExcelProperty(value = "id4")
    private String avatar;

    @ExcelProperty(value = "id5")
    private String email;

    @ExcelProperty(value = "id6")
    private String city;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @ExcelProperty(value = "id7")
    private LocalDateTime lastLogin;

    @TableField(exist = false)
    @ExcelIgnore
    private List<SysRole> sysRoles = new ArrayList<>();

    @TableField(exist = false)
    @ExcelIgnore
    private List<Long> roles = new ArrayList<>();


}
